\(\int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [260]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 82 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {(e+f x)^3}{3 a f}-\frac {2 i f^2 \cosh (c+d x)}{a d^3}-\frac {i (e+f x)^2 \cosh (c+d x)}{a d}+\frac {2 i f (e+f x) \sinh (c+d x)}{a d^2} \]

[Out]

1/3*(f*x+e)^3/a/f-2*I*f^2*cosh(d*x+c)/a/d^3-I*(f*x+e)^2*cosh(d*x+c)/a/d+2*I*f*(f*x+e)*sinh(d*x+c)/a/d^2

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {5682, 32, 3377, 2718} \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {2 i f^2 \cosh (c+d x)}{a d^3}+\frac {2 i f (e+f x) \sinh (c+d x)}{a d^2}-\frac {i (e+f x)^2 \cosh (c+d x)}{a d}+\frac {(e+f x)^3}{3 a f} \]

[In]

Int[((e + f*x)^2*Cosh[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(e + f*x)^3/(3*a*f) - ((2*I)*f^2*Cosh[c + d*x])/(a*d^3) - (I*(e + f*x)^2*Cosh[c + d*x])/(a*d) + ((2*I)*f*(e +
f*x)*Sinh[c + d*x])/(a*d^2)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 5682

Int[(Cosh[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Symb
ol] :> Dist[1/a, Int[(e + f*x)^m*Cosh[c + d*x]^(n - 2), x], x] + Dist[1/b, Int[(e + f*x)^m*Cosh[c + d*x]^(n -
2)*Sinh[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int (e+f x)^2 \sinh (c+d x) \, dx}{a}+\frac {\int (e+f x)^2 \, dx}{a} \\ & = \frac {(e+f x)^3}{3 a f}-\frac {i (e+f x)^2 \cosh (c+d x)}{a d}+\frac {(2 i f) \int (e+f x) \cosh (c+d x) \, dx}{a d} \\ & = \frac {(e+f x)^3}{3 a f}-\frac {i (e+f x)^2 \cosh (c+d x)}{a d}+\frac {2 i f (e+f x) \sinh (c+d x)}{a d^2}-\frac {\left (2 i f^2\right ) \int \sinh (c+d x) \, dx}{a d^2} \\ & = \frac {(e+f x)^3}{3 a f}-\frac {2 i f^2 \cosh (c+d x)}{a d^3}-\frac {i (e+f x)^2 \cosh (c+d x)}{a d}+\frac {2 i f (e+f x) \sinh (c+d x)}{a d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.94 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.95 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {d^3 x \left (3 e^2+3 e f x+f^2 x^2\right )-3 i \left (2 f^2+d^2 (e+f x)^2\right ) \cosh (c+d x)+6 i d f (e+f x) \sinh (c+d x)}{3 a d^3} \]

[In]

Integrate[((e + f*x)^2*Cosh[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(d^3*x*(3*e^2 + 3*e*f*x + f^2*x^2) - (3*I)*(2*f^2 + d^2*(e + f*x)^2)*Cosh[c + d*x] + (6*I)*d*f*(e + f*x)*Sinh[
c + d*x])/(3*a*d^3)

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 159 vs. \(2 (77 ) = 154\).

Time = 6.81 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.95

method result size
risch \(\frac {f^{2} x^{3}}{3 a}+\frac {f e \,x^{2}}{a}+\frac {e^{2} x}{a}+\frac {e^{3}}{3 a f}-\frac {i \left (d^{2} x^{2} f^{2}+2 d^{2} e f x +d^{2} e^{2}-2 x d \,f^{2}-2 d e f +2 f^{2}\right ) {\mathrm e}^{d x +c}}{2 d^{3} a}-\frac {i \left (d^{2} x^{2} f^{2}+2 d^{2} e f x +d^{2} e^{2}+2 x d \,f^{2}+2 d e f +2 f^{2}\right ) {\mathrm e}^{-d x -c}}{2 d^{3} a}\) \(160\)
derivativedivides \(-\frac {i c^{2} f^{2} \cosh \left (d x +c \right )-2 i c d e f \cosh \left (d x +c \right )-2 i c \,f^{2} \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+i d^{2} e^{2} \cosh \left (d x +c \right )+2 i d e f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+i f^{2} \left (\left (d x +c \right )^{2} \cosh \left (d x +c \right )-2 \left (d x +c \right ) \sinh \left (d x +c \right )+2 \cosh \left (d x +c \right )\right )-c^{2} f^{2} \left (d x +c \right )+2 c d e f \left (d x +c \right )+c \,f^{2} \left (d x +c \right )^{2}-d^{2} e^{2} \left (d x +c \right )-d e f \left (d x +c \right )^{2}-\frac {f^{2} \left (d x +c \right )^{3}}{3}}{d^{3} a}\) \(223\)
default \(-\frac {i c^{2} f^{2} \cosh \left (d x +c \right )-2 i c d e f \cosh \left (d x +c \right )-2 i c \,f^{2} \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+i d^{2} e^{2} \cosh \left (d x +c \right )+2 i d e f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+i f^{2} \left (\left (d x +c \right )^{2} \cosh \left (d x +c \right )-2 \left (d x +c \right ) \sinh \left (d x +c \right )+2 \cosh \left (d x +c \right )\right )-c^{2} f^{2} \left (d x +c \right )+2 c d e f \left (d x +c \right )+c \,f^{2} \left (d x +c \right )^{2}-d^{2} e^{2} \left (d x +c \right )-d e f \left (d x +c \right )^{2}-\frac {f^{2} \left (d x +c \right )^{3}}{3}}{d^{3} a}\) \(223\)

[In]

int((f*x+e)^2*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/3/a*f^2*x^3+1/a*f*e*x^2+1/a*e^2*x+1/3/a/f*e^3-1/2*I*(d^2*f^2*x^2+2*d^2*e*f*x+d^2*e^2-2*d*f^2*x-2*d*e*f+2*f^2
)/d^3/a*exp(d*x+c)-1/2*I*(d^2*f^2*x^2+2*d^2*e*f*x+d^2*e^2+2*d*f^2*x+2*d*e*f+2*f^2)/d^3/a*exp(-d*x-c)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (74) = 148\).

Time = 0.23 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.95 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {{\left (-3 i \, d^{2} f^{2} x^{2} - 3 i \, d^{2} e^{2} - 6 i \, d e f - 6 i \, f^{2} - 6 \, {\left (i \, d^{2} e f + i \, d f^{2}\right )} x - 3 \, {\left (i \, d^{2} f^{2} x^{2} + i \, d^{2} e^{2} - 2 i \, d e f + 2 i \, f^{2} + 2 \, {\left (i \, d^{2} e f - i \, d f^{2}\right )} x\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d^{3} f^{2} x^{3} + 3 \, d^{3} e f x^{2} + 3 \, d^{3} e^{2} x\right )} e^{\left (d x + c\right )}\right )} e^{\left (-d x - c\right )}}{6 \, a d^{3}} \]

[In]

integrate((f*x+e)^2*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(-3*I*d^2*f^2*x^2 - 3*I*d^2*e^2 - 6*I*d*e*f - 6*I*f^2 - 6*(I*d^2*e*f + I*d*f^2)*x - 3*(I*d^2*f^2*x^2 + I*d
^2*e^2 - 2*I*d*e*f + 2*I*f^2 + 2*(I*d^2*e*f - I*d*f^2)*x)*e^(2*d*x + 2*c) + 2*(d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3
*d^3*e^2*x)*e^(d*x + c))*e^(-d*x - c)/(a*d^3)

Sympy [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 318, normalized size of antiderivative = 3.88 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\begin {cases} \frac {\left (\left (- 2 i a d^{5} e^{2} - 4 i a d^{5} e f x - 2 i a d^{5} f^{2} x^{2} - 4 i a d^{4} e f - 4 i a d^{4} f^{2} x - 4 i a d^{3} f^{2}\right ) e^{- d x} + \left (- 2 i a d^{5} e^{2} e^{2 c} - 4 i a d^{5} e f x e^{2 c} - 2 i a d^{5} f^{2} x^{2} e^{2 c} + 4 i a d^{4} e f e^{2 c} + 4 i a d^{4} f^{2} x e^{2 c} - 4 i a d^{3} f^{2} e^{2 c}\right ) e^{d x}\right ) e^{- c}}{4 a^{2} d^{6}} & \text {for}\: a^{2} d^{6} e^{c} \neq 0 \\\frac {x^{3} \left (- i f^{2} e^{2 c} + i f^{2}\right ) e^{- c}}{6 a} + \frac {x^{2} \left (- i e f e^{2 c} + i e f\right ) e^{- c}}{2 a} + \frac {x \left (- i e^{2} e^{2 c} + i e^{2}\right ) e^{- c}}{2 a} & \text {otherwise} \end {cases} + \frac {e^{2} x}{a} + \frac {e f x^{2}}{a} + \frac {f^{2} x^{3}}{3 a} \]

[In]

integrate((f*x+e)**2*cosh(d*x+c)**2/(a+I*a*sinh(d*x+c)),x)

[Out]

Piecewise((((-2*I*a*d**5*e**2 - 4*I*a*d**5*e*f*x - 2*I*a*d**5*f**2*x**2 - 4*I*a*d**4*e*f - 4*I*a*d**4*f**2*x -
 4*I*a*d**3*f**2)*exp(-d*x) + (-2*I*a*d**5*e**2*exp(2*c) - 4*I*a*d**5*e*f*x*exp(2*c) - 2*I*a*d**5*f**2*x**2*ex
p(2*c) + 4*I*a*d**4*e*f*exp(2*c) + 4*I*a*d**4*f**2*x*exp(2*c) - 4*I*a*d**3*f**2*exp(2*c))*exp(d*x))*exp(-c)/(4
*a**2*d**6), Ne(a**2*d**6*exp(c), 0)), (x**3*(-I*f**2*exp(2*c) + I*f**2)*exp(-c)/(6*a) + x**2*(-I*e*f*exp(2*c)
 + I*e*f)*exp(-c)/(2*a) + x*(-I*e**2*exp(2*c) + I*e**2)*exp(-c)/(2*a), True)) + e**2*x/a + e*f*x**2/a + f**2*x
**3/(3*a)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 270 vs. \(2 (74) = 148\).

Time = 0.31 (sec) , antiderivative size = 270, normalized size of antiderivative = 3.29 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=e f {\left (\frac {2 \, x e^{\left (d x + c\right )}}{a d e^{\left (d x + c\right )} - i \, a d} - \frac {i \, d^{2} x^{2} e^{c} + i \, d x e^{c} - {\left (-i \, d x e^{\left (3 \, c\right )} + i \, e^{\left (3 \, c\right )}\right )} e^{\left (2 \, d x\right )} - {\left (d^{2} x^{2} e^{\left (2 \, c\right )} - 3 \, d x e^{\left (2 \, c\right )} + e^{\left (2 \, c\right )}\right )} e^{\left (d x\right )} + {\left (d x + 1\right )} e^{\left (-d x\right )} + i \, e^{c}}{a d^{2} e^{\left (d x + 2 \, c\right )} - i \, a d^{2} e^{c}}\right )} + \frac {1}{2} \, e^{2} {\left (\frac {2 \, {\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (-d x - c\right )}}{a d}\right )} + \frac {{\left (2 \, d^{3} x^{3} e^{c} + 3 \, {\left (-i \, d^{2} x^{2} e^{\left (2 \, c\right )} + 2 i \, d x e^{\left (2 \, c\right )} - 2 i \, e^{\left (2 \, c\right )}\right )} e^{\left (d x\right )} + 3 \, {\left (-i \, d^{2} x^{2} - 2 i \, d x - 2 i\right )} e^{\left (-d x\right )}\right )} f^{2} e^{\left (-c\right )}}{6 \, a d^{3}} \]

[In]

integrate((f*x+e)^2*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

e*f*(2*x*e^(d*x + c)/(a*d*e^(d*x + c) - I*a*d) - (I*d^2*x^2*e^c + I*d*x*e^c - (-I*d*x*e^(3*c) + I*e^(3*c))*e^(
2*d*x) - (d^2*x^2*e^(2*c) - 3*d*x*e^(2*c) + e^(2*c))*e^(d*x) + (d*x + 1)*e^(-d*x) + I*e^c)/(a*d^2*e^(d*x + 2*c
) - I*a*d^2*e^c)) + 1/2*e^2*(2*(d*x + c)/(a*d) - I*e^(d*x + c)/(a*d) - I*e^(-d*x - c)/(a*d)) + 1/6*(2*d^3*x^3*
e^c + 3*(-I*d^2*x^2*e^(2*c) + 2*I*d*x*e^(2*c) - 2*I*e^(2*c))*e^(d*x) + 3*(-I*d^2*x^2 - 2*I*d*x - 2*I)*e^(-d*x)
)*f^2*e^(-c)/(a*d^3)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 208 vs. \(2 (74) = 148\).

Time = 0.28 (sec) , antiderivative size = 208, normalized size of antiderivative = 2.54 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {{\left (2 \, d^{3} f^{2} x^{3} e^{\left (d x + c\right )} + 6 \, d^{3} e f x^{2} e^{\left (d x + c\right )} - 3 i \, d^{2} f^{2} x^{2} e^{\left (2 \, d x + 2 \, c\right )} + 6 \, d^{3} e^{2} x e^{\left (d x + c\right )} - 3 i \, d^{2} f^{2} x^{2} - 6 i \, d^{2} e f x e^{\left (2 \, d x + 2 \, c\right )} - 6 i \, d^{2} e f x - 3 i \, d^{2} e^{2} e^{\left (2 \, d x + 2 \, c\right )} + 6 i \, d f^{2} x e^{\left (2 \, d x + 2 \, c\right )} - 3 i \, d^{2} e^{2} - 6 i \, d f^{2} x + 6 i \, d e f e^{\left (2 \, d x + 2 \, c\right )} - 6 i \, d e f - 6 i \, f^{2} e^{\left (2 \, d x + 2 \, c\right )} - 6 i \, f^{2}\right )} e^{\left (-d x - c\right )}}{6 \, a d^{3}} \]

[In]

integrate((f*x+e)^2*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

1/6*(2*d^3*f^2*x^3*e^(d*x + c) + 6*d^3*e*f*x^2*e^(d*x + c) - 3*I*d^2*f^2*x^2*e^(2*d*x + 2*c) + 6*d^3*e^2*x*e^(
d*x + c) - 3*I*d^2*f^2*x^2 - 6*I*d^2*e*f*x*e^(2*d*x + 2*c) - 6*I*d^2*e*f*x - 3*I*d^2*e^2*e^(2*d*x + 2*c) + 6*I
*d*f^2*x*e^(2*d*x + 2*c) - 3*I*d^2*e^2 - 6*I*d*f^2*x + 6*I*d*e*f*e^(2*d*x + 2*c) - 6*I*d*e*f - 6*I*f^2*e^(2*d*
x + 2*c) - 6*I*f^2)*e^(-d*x - c)/(a*d^3)

Mupad [B] (verification not implemented)

Time = 1.31 (sec) , antiderivative size = 167, normalized size of antiderivative = 2.04 \[ \int \frac {(e+f x)^2 \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {e^2\,x}{a}-{\mathrm {e}}^{-c-d\,x}\,\left (\frac {\left (d^2\,e^2+2\,d\,e\,f+2\,f^2\right )\,1{}\mathrm {i}}{2\,a\,d^3}+\frac {f^2\,x^2\,1{}\mathrm {i}}{2\,a\,d}+\frac {f\,x\,\left (f+d\,e\right )\,1{}\mathrm {i}}{a\,d^2}\right )-{\mathrm {e}}^{c+d\,x}\,\left (\frac {\left (d^2\,e^2-2\,d\,e\,f+2\,f^2\right )\,1{}\mathrm {i}}{2\,a\,d^3}+\frac {f^2\,x^2\,1{}\mathrm {i}}{2\,a\,d}-\frac {f\,x\,\left (f-d\,e\right )\,1{}\mathrm {i}}{a\,d^2}\right )+\frac {f^2\,x^3}{3\,a}+\frac {e\,f\,x^2}{a} \]

[In]

int((cosh(c + d*x)^2*(e + f*x)^2)/(a + a*sinh(c + d*x)*1i),x)

[Out]

(e^2*x)/a - exp(- c - d*x)*(((2*f^2 + d^2*e^2 + 2*d*e*f)*1i)/(2*a*d^3) + (f^2*x^2*1i)/(2*a*d) + (f*x*(f + d*e)
*1i)/(a*d^2)) - exp(c + d*x)*(((2*f^2 + d^2*e^2 - 2*d*e*f)*1i)/(2*a*d^3) + (f^2*x^2*1i)/(2*a*d) - (f*x*(f - d*
e)*1i)/(a*d^2)) + (f^2*x^3)/(3*a) + (e*f*x^2)/a